# HTML Element Construction Library.
from html import HTMLElement
vars().update(dict((_, HTMLElement(_)) for _ in
                   ['HTML', 'HEAD', 'TITLE',
                    'SCRIPT', 'LINK', 'META',
                    'BODY', 'DIV', 'P', 'SPAN', 'HR', 'BR',
                    'H1', 'H2', 'H3', 'H4', 'H5', 'H6',
                    'TABLE', 'TR', 'TD']))

def ExternalStylesheet(href, media = None):
    values = dict(href = href, rel = 'stylesheet', type = 'text/css')
    if media is not None:
        values['media'] = media

    return LINK(**values)

# Django Template Filters & Tag Construction Library.
